import sqlalchemy as sa

from .db import SqlAlchemyBase


class Hub(SqlAlchemyBase):
    __tablename__ = "hubs"

    id = sa.Column(
        sa.UUID(as_uuid=True),
        primary_key=True,
        server_default=sa.text("gen_random_uuid()"),
    )
    addr = sa.Column(sa.String, unique=True)
    pubkey = sa.Column(sa.String)
    name = sa.Column(sa.String(255))
    config = sa.Column(sa.String, default="")
    version = sa.Column(sa.Integer)
    latest_update = sa.Column(sa.Integer)
